class Solution {
public:
	void dfs(TreeNode* root, vector<int>& answer) {
		if (root == NULL) {
			return;
		}
		dfs(root->left, answer);
		dfs(root->right, answer);
		answer.push_back(root->val);
	}
	vector<int> postorderTraversal(TreeNode* root) {
		vector<int>answer;
		dfs(root, answer);
		return answer;
	}
};